#ifndef QRSAGSMAPSWIPE_H
#define QRSAGSMAPSWIPE_H

#include <QRectF>
#include <QPointF>
#include <QPen>
#include <QColor>
#include <QList>
#include <QPainter>
#include <QStyleOptionGraphicsItem>
#include <QWidget>
#include "qgsmapcanvasitem.h"
#include "qgsrectangle.h"
#include "qgsmapcanvas.h"

class QRSAGSMapSwipe : public QgsMapCanvasItem
{
public:
    QRSAGSMapSwipe(QgsMapCanvas *mapCanvas = nullptr);
    ~QRSAGSMapSwipe();

    QgsMapCanvas *mMapCanvas = nullptr;
    int length = 0;
    bool isVertical= true;
    bool flg = false;
    bool isPaint= false;
    int direction = 0;
//    int startX, startY, endX, endY;
//    int x, y;
    QImage copyImage;

    QList<QgsMapLayer *> mMapLayers;

    void clear();
    void setLayers(QList<QgsMapLayer*> mapLayerList);
    void setIsVertical(bool isVertical);
    void setLength(int x, int y);
    void setImage(QImage image);

    QList<QgsMapLayer *> getMapLayers();
//    void setDirection(int direction);
//    void setImageExtent(int x, int y);
//    void setContent(QImage image,QgsRectangle rectangle);

    // QgsMapCanvasItem interface
protected:
    void paint(QPainter *painter);

//private slots:
//    void setMap();
};

#endif // QRSAGSMAPSWIPE_H
